using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using OVS.BusinessObjects;
using OVS.DAL;

namespace OVS.BLL
{
	public partial class VideoBLL
	{
		private VideoDAO _VideoDAO;

		public VideoDAO VideoDAO
		{
			get { return _VideoDAO; }
			set { _VideoDAO = value; }
		}

		public VideoBLL()
		{
			VideoDAO = new VideoDAO();
		}
		public List<Video> GetVideos()
		{
			try
			{
				return VideoDAO.GetVideos();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Video GetVideo(int vide_id)
		{
			try
			{
				return VideoDAO.GetVideo(vide_id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddVideo(Video oVideo)
		{
			try
			{
				return VideoDAO.AddVideo(oVideo);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateVideo(Video oVideo)
		{
			try
			{
				return VideoDAO.UpdateVideo(oVideo);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveVideo(Video oVideo)
		{
			try
			{
				return VideoDAO.RemoveVideo(oVideo);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveVideo(int vide_id)
		{
			try
			{
				return VideoDAO.RemoveVideo(vide_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Video> DeserializeVideos(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Video>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeVideos(string Path, List<Video> Videos)
		{
			try
			{
				GenericXmlSerializer<List<Video>>.Serialize(Videos, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
